// eslint-disable-next-line no-use-before-define
import React, { lazy } from 'react';
import { Route } from 'react-router-dom';
const Home = lazy(() => import(/* webpackChunkName: "Index"*/ '@pages/home/index'));
const Bridge = lazy(() => import(/* webpackChunkName: "Index"*/ '@pages/bridge/index'));
const Genesis = lazy(() => import(/* webpackChunkName: "Index"*/ '@pages/genesis/index'));

const routes = [
    {
        // 首页
        path: '/index',
        component: Home
    },
    {
        // 首页
        path: '/bridge',
        component: Bridge
    },
    {
        // 首页
        path: '/genesis',
        component: Genesis
    }
];

const rootConfig = routes.map(route => {
    const { component: Component } = route;
    return <Route key={route.path} path={route.path} exact component={Component} />;
});
export default rootConfig;
